All Questions
Tagged with binary-treetime-limit-exceeded
4 questions
1vote
3answers
142views
Maximum Sum BST in a Binary Tree
I was trying to find the Maximum sum BST of a binary tree on LeetCode. While the Java code I have come up with, mostly seems right and is able to pass 55 out of the given 59 test cases too, the error ...
2votes
1answer
87views
Sort array of numbers using tree sort - Leetcode 912
Problem statement: Sort integer array nums in O(N log N) time, without relying on any library sort routine. I am trying to use a tree sort method (using the ...
4votes
2answers
129views
Delete a node in binary tree
Problem Statement Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST. Basically, the deletion ...
2votes
1answer
140views
HackerRank - Binary tree to compute the Nth power of natural numbers that sum up to X
I'm trying to solve this challenge on HackerRank. In short, given x and n, I have to determine how many ways I can pick numbers ...